﻿using GMap.NET.WindowsForms;
using GMap.NET;
using System.Drawing;

namespace BusStationClient
{    
    public  class MyLocationMarker : GMapMarker
    {
        private Bitmap _b;
        private string _name;
        private PointLatLng _p;

        public MyLocationMarker(PointLatLng pp, Bitmap bitmap, string name) 
           : base(pp)
       {
           // Pen = new Pen(Brushes.Blue, 5);
           //btsIcon =  Image.FromFile("C:\\red.gif");
           Size = new System.Drawing.Size(32, 32);//图钉的大小
           Offset = new System.Drawing.Point(0, 0);//图像的位置

            this._b = bitmap;
            this._name = name;
            this._p = pp;

       }
 
        //画基站的图像
       public override void OnRender(Graphics g)
       {
           float size = ((float)_name.Length) / 2;
           g.DrawImageUnscaled(_b, LocalPosition.X-15, LocalPosition.Y-12);
           g.DrawString(_name, new Font("黑体", 11.0f,FontStyle.Bold),
               Brushes.Green, (float)(this.LocalPosition.X - size * 15),
               (float)(this.LocalPosition.Y+38));

       }
    }


   
}
